package com.example.featuresdk.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.Colors
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable

@Composable
fun DemoTheme(
    darkTheme: Boolean = isSystemInDarkTheme(),
    content: @Composable() () -> Unit
) {
    MaterialTheme(
        colors = if (darkTheme) { DarkColorPalette } else { LightColorPalette },
        content = content
    )
}

//Define this utility object to access customized theme in a consistent manner as MaterialTheme,
// e.g. DemoTheme.colors.background
// e.g. DemoTheme.typography.header
// e.g. DemoTheme.shapes.small
object DemoTheme {
    val colors: Colors
        @Composable
        get() = MaterialTheme.colors

    val typography: DemoTypography
        @Composable
        get() = LocalDemoTypography.current

    val shapes: DemoShapes
        @Composable
        get() = LocalDemoShapes.current
}

